<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<ul>
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
		<script type="text/javascript">
			var oLi = document.getElementsByTagName('li'),
				len = oLi.length,
				item;
				
				for (var i = 0; i< len; i++){
					item = oLi[i];
					(function(j){
						item.addEventListener('click', function(){
							console.log(j+1);
						})
					})(i);
				}
		</script>
	</body>
</html>
